﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CNRS.gaas
{
	/// <summary>
	/// CNRSgaas test program
	/// this code is distributed under CeCILL 2.1 license, fully compatible with the GNU GPL license (http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html)
	///
	/// (C) CNRS - Jean Marie THIA - April 2015
	/// </summary>
	class Program
	{
		static void Main(string[] args)
		{
			CNRSgaas attributeStore = new CNRSgaas();
			Dictionary<string, string> config = new Dictionary<string, string>();

			config.Add("vootUrl", @"http://mgigrouper1:8080/grouper-ws/voot");
			config.Add("userName", "GrouperSystem");
			config.Add("password", "Passw0rd");
			string user = "GrouperSystem";
			
			attributeStore.Initialize(config);

			IAsyncResult result = attributeStore.BeginExecuteQuery("unsued", new string[] { user }, null, null);

			string[][] data = attributeStore.EndExecuteQuery(result);
			foreach (string[] row in data)
			{
				foreach (string col in row)
				{
					Console.Write("{0}\t\t", col);
				}
				Console.WriteLine();
			}
		}
	}
}
